package mysql

import "gorm.io/gorm"

type Registration struct {
	gorm.Model
	Name               string  `gorm:"type:varchar(20);not null;comment:患者姓名"`
	Mobile             string  `gorm:"type:char(11);not null;comment:手机号"`
	RegistrationNumber int64   `gorm:"type:varchar(20);not null;comment:挂号科室"`
	Price              float64 `gorm:"type:decimal(10,2);not null;comment:挂号费"`
	RegistrationTime   string  `gorm:"type:varchar(20);not null;comment:挂号时间"`
}

func (r *Registration) RegistrationAdd() error {
	return DB.Debug().Create(&r).Error
}

func (r *Registration) GetList() ([]Registration, error) {
	var registration []Registration
	err := DB.Debug().Find(&registration).Error

	return registration, err
}
